package cn.com.server.service;

import java.sql.SQLDataException;

import com.github.pagehelper.Page;

import cn.com.server.entity.User;
import cn.com.server.extend.model.RegisterSaveModel;
import cn.com.server.extend.view.UserView;
import cn.com.server.extend.model.UserViewModel;

/**
 * <p>
 * 用户表 服务类
 * </p>
 *
 * @author qing
 * @since 2017-11-20
 */
public interface UserService {
	User selectByName(String name);

	UserView selectById(Long id);
	
	int insert(User entity);
	
	int update(User entity);

	int insertUserAndTerminalAndUserRole(RegisterSaveModel model) throws SQLDataException;
	
	int insertUserAndUserRole(RegisterSaveModel model) throws SQLDataException;
	
	int updateUserAndUserRole(RegisterSaveModel model);

	int updateUserAndTerminalAndUserRole(RegisterSaveModel model) throws SQLDataException;
	
	Page<UserView> selectUserViewList(UserViewModel model);

	int deleteUpdateUserAndUserRoleAndTerminal(String ids) throws SQLDataException;

}
